package com.youdianda.mapper;

import com.youdianda.entity.*;
import com.youdianda.vo.ConfigFgxVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysIndexFgxMapper {
    @Select("select * from youdianda.sys_config where tab_value=#{system}")
    List<SysConfig> getConfig(String system);

    @Select("select * from youdianda.sys_user where login_name=#{username}")
    SysFgxUser getByUsername(String username);

    @Select("select * from youdianda.sys_user where id=#{sysUserId}")
    SysFgxUser userInfo(Long sysUserId);

    @Select("select * from youdianda.sys_menu where type=#{menu}")
    List<SysFgxMenu> menuList(String menu);

    @Select("select * from youdianda.sys_dict where type=#{interface_type}")
    List<SysFgxDict> dictsList(String interface_type);

    @Select("select * from youdianda.ydd_cate")
    List<YddFgxCate> allcate();

    @Select("select * from youdianda.ydd_article where ishot = #{i} order by create_date desc")
    List<YddArticle> hotArticle(int i);

    @Select("select * from youdianda.ydd_user where default_data is null")
    List<YddUser> newUser();

    @Select("select count(*) from youdianda.ydd_user")
    Integer userSum();

    @Select("select count(sex) from youdianda.ydd_user where sex=#{i}")
    Integer userSexSum(int i);

    @Select("select count(*) from youdianda.ydd_advpos")
    Integer advposNum();

    @Select("select count(*) from youdianda.ydd_article")
    Integer articleNum();

    @Select("select count(*) from youdianda.ydd_advimg")
    Integer advimgNum();

    @Select("select count(*) from youdianda.ydd_tag")
    Integer tagNum();

    @Select("select count(*) from youdianda.sys_role where superadmin=1")
    Integer adminNum();

    @Select("select * from youdianda.sys_config where group_value=#{s}")
    List<ConfigFgxVO> checkByGroupValue(String s);
}
